import http from "@/api/axios";
import { BusinessType } from "@/api/moduleConfig";
export const getListApi = (data: PaymentApproval.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/pagePaymentWaitApply`,
    data
  });
};
export const getApprovalListApi = (data: PaymentApproval.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/applyPage`,
    data
  });
};
export const getPageStaticApi = (data: PaymentApproval.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/pageStatCount`,
    data
  });
};
// 待申请-详情
export const getApplyInfoApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/getStatementDetail/${id}`
  });
};
// 撤销账单
export const revokePayableStatementApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/revokePayableStatement/${id}`
  });
};
// 获取待申请 账单费用
export const getApplyCostListApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/startPaymentApplyList`,
    data
  });
};
// 待申请 发起申请
export const applySponsorApi = (data: PaymentApproval.ApplySponsor) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/startPaymentApply`,
    data
  });
};
// 待审批 详情
export const approvalPendingInfoApi = (applyNo: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/getPayApplyDetail/${applyNo}`
  });
};
//  撤回申请
export const withDrawApplyApi = (id: string) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/withdrawApply/${id}`
  });
};
// 通过申请
export const passApplyApi = (data: string[]) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/passApply`,
    data
  });
};
// 驳回申请
export const refuseApplyApi = (data: { idList: Array<string>; applyResult: string | undefined }) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/refuseApply`,
    data
  });
};
// 核销费用 详情
export const getWriteOffFeeInfoApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentSerial/getFinanceWriteAmountData`,
    data
  });
};
// 核销费用
export const writeOffFeeApi = (data: { id: string; applyIdList: Array<string> }) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentSerial/writeAmount`,
    data
  });
};
// 驳回-重新提交
export const reSubmitApplyApi = (data: Array<string>) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/reSubmitApply`,
    data
  });
};
// 待申请 导出
export const preApplyExportDataApi = (data: PaymentApproval.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/exportPaymentWaitApply`,
    data,
    responseType: "blob"
  });
};
// 审批节点导出
export const approvalExportDataApi = (data: PaymentApproval.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/exportApplyData`,
    data,
    responseType: "blob"
  });
};
// 统计 待申请
export const statisticsDataApi = (data: PaymentApproval.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/getPayWaitApplyStatistics`,
    data
  });
};
// 统计 审批节点
export const statisticsDataApplyApi = (data: PaymentApproval.SearchParams) => {
  return http({
    method: "post",
    url: `${BusinessType.finance}/biz/financePaymentApply/getApplyPaymentStatisticsRes`,
    data
  });
};
